<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数和class2Clone.html</title>
</head>
<body>
    <script>
        function Parent(username,age){
            this.suername = username
            this.age = age
        }
        Parent.prototype.say = function (){
            console.log('用户信息',`用户名：${this.suername},年龄：${this.age}`)
        }
        let p1 = new Parent("张三",18)
        pa1.say()
        let p2 = new Parent("李四",10)
        p2.say()

        class Parent1{
            constructor(usernmae,age){
                this.suername=username
                this.age = age
            }
            say(){
                console.log('=====class用户信息：',`用户名：${this.suername},年龄:${this.age}`)
            }
        }
        let p11 = new Parent ("张三",19)
        p11.say()
        let p22 = new Parent ("李四", 20)
        p22.say()

        class Child1 extends Parent1{
            constructor (username,age,email){
                super(username,age)
                this.email=email
            }
            static isType = 'admin'

            say(){
                console.log('====class用户信息',this,`用户名：${this.username},年龄：${this.age},邮箱：${this.email }`)
            }
        }
        console.log('-------------child---------')
        let c1 = new Child1('王刚',30,'test@qq.com')
        console.log('c1',c1,c1.isType,Child1,isType)
        c1.say()
    </script>
</body>
</html>